<?php
/*
 *                                                     __----~~~~~~~~~~~------___
 *                                    .  .   ~~//====......          __--~ ~~
 *                    -.            \_|//     |||\\  ~~~~~~::::... /~
 *                 ___-==_       _-~o~  \/    |||  \\            _/~~-
 *         __---~~~.==~||\=_    -_--~/_-~|-   |\\   \\        _/~
 *     _-~~     .=~    |  \\-_    '-~7  /-   /  ||    \      /
 *   .~       .~       |   \\ -_    /  /-   /   ||      \   /
 *  /  ____  /         |     \\ ~-_/  /|- _/   .||       \ /
 *  |~~    ~~|--~~~~--_ \     ~==-/   | \~--===~~        .\
 *           '         ~-|      /|    |-~\~~       __--~~
 *                       |-~~-_/ |    |   ~\_   _-~            /\
 *                            /  \     \__   \/~                \__
 *                        _--~ _/ | .-~~____--~-/                  ~~==.
 *                       ((->/~   '.|||' -_|    ~~-/ ,              . _||
 *                                  -_     ~\      ~~---l__i__i__i--~~_/
 *                                  _-~-__   ~)  \--______________--~~
 *                                //.-~~~-~_--~- |-------~~~~~~~~
 *                                       //.-~~~--\
 *                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * 
 *                               神兽保佑            永无BUG
 * 
 * @Date         : 2020-09-02 17:03:09
 * @Author       : 真友
 * @Description  : 本代码由【真友】大力敲打
 */

namespace app\common;

class Waimai
{
  public function ddx_meituan($query = array())
  {
    // $query['activity_material_id'] = '1579491209717';
    // $query['adzone_id'] = '1971666093';
    // $r = $tb->get('taobao.tbk.activity.info.get',$query);
    // return $r;
    $apikey = getSettingCode('ddx_appkey');
    $apikey = $apikey;
    $http = new \app\common\Http();
    $query['apikey'] = $apikey;
    $r = $http->post('http://api.tbk.dingdanxia.com/waimai/meituan_privilege',$query);
    return $r;
  }

  public function ddx_get($api = '',$query = array())
  {
    // $query['activity_material_id'] = '1579491209717';
    // $query['adzone_id'] = '1971666093';
    // $r = $tb->get('taobao.tbk.activity.info.get',$query);
    // return $r;
    $apikey = getSettingCode('ddx_appkey');
    $apikey = $apikey;
    $http = new \app\common\Http();
    $query['apikey'] = $apikey;
    $r = $http->post('http://api.tbk.dingdanxia.com/'.$api,$query);
    return $r;
  }

  public function ddx_ele($query = array())
  {
    $apikey = 'r8QbBossxwLwHDv7phRG0v3Yu16BT0wc';
    $http = new \app\common\Http();
    $query['apikey'] = $apikey;
    $query['activity_material_id'] = '1571715733668';
    $r = $http->post('http://api.tbk.dingdanxia.com/tbk/activityinfo',$query);
    return $r;
  }
}